package com.laiketui.order.api.enums;

import java.util.Objects;

public enum OrderSourceEnum {
    LUOKOO(1, "珞珂家居PC端");
    private final int code;
    private final String desc;
    private OrderSourceEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getDecByCode(Integer code){
        if(Objects.isNull(code)){
            return LUOKOO.desc;
        }
        for(OrderSourceEnum e : OrderSourceEnum.values()){
            if(e.getCode() == code){
                return e.getDesc();
            }
        }
        return LUOKOO.desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
